package com.kymatrix.mpo.plus.bpm.server.dao.definition;

import com.kymatrix.mpo.plus.bpm.server.config.mybatis.mapper.BaseMapperX;
import com.kymatrix.mpo.plus.bpm.server.config.mybatis.query.LambdaQueryWrapperX;
import com.kymatrix.mpo.plus.bpm.server.model.entity.definition.BpmProcessExpressionEntity;
import com.kymatrix.mpo.plus.bpm.server.model.form.expression.PageQueryBpmProcessExpressionPageReq;
import com.kymatrix.mpo.plus.common.business.common.PageResp;
import org.apache.ibatis.annotations.Mapper;

/**
 * BPM 流程表达式 Mapper
 *
 */
@Mapper
public interface BpmProcessExpressionMapper extends BaseMapperX<BpmProcessExpressionEntity> {

    default PageResp<BpmProcessExpressionEntity> selectPage(PageQueryBpmProcessExpressionPageReq reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessExpressionEntity>()
                .likeIfPresent(BpmProcessExpressionEntity::getName, reqVO.getName())
                .eqIfPresent(BpmProcessExpressionEntity::getStatus, reqVO.getStatus())
                .betweenIfPresent(BpmProcessExpressionEntity::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BpmProcessExpressionEntity::getId));
    }

}
